<h1>Listing leaves</h1>

<table>
  <tr>
    <th>Employee</th>
    <th>Start date</th>
    <th>End date</th>
    <th>Type of leave</th>
  </tr>

<% @leaves.each do |leave| %>
  <tr>
    <td><%=h leave.employee_id %></td>
    <td><%=h leave.start_date %></td>
    <td><%=h leave.end_date %></td>
    <td><%=h leave.type_of_leave_id %></td>
    <td><%= link_to 'Show', leave %></td>
    <td><%= link_to 'Edit', edit_leave_path(leave) %></td>
    <td><%= link_to 'Destroy', leave, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New leave', new_leave_path %>